home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / BBS_UTL / DDPLUS71 / MACROKEY.ZIP / MACROKEY.PAS < prev   
Pascal/Delphi Source File  |  1995-03-14  |  1KB  |  64 lines

  1. unit MacroKey;
  2.  
  3. interface
  4.  
  5. uses DOS, CRT, DDPlus, DDScott;
  6.  
  7. procedure record_macro(var s: string);
  8. procedure display_macro(s: string);
  9.  
  10. implementation
  11.  
  12. procedure record_macro(var s: string);
  13. var
  14.  ch: char;
  15.  ln: byte;
  16. begin;
  17.  ln:=1;
  18.  s:='';
  19.  set_foreground(lightblue);
  20.  swrite(va(ln)+'> ');
  21.  set_foreground(white);
  22.  repeat;
  23.   sread_char(ch);
  24.   if ch<>^n then begin;
  25.    swrite(ch);
  26.    if ch=#13 then begin;
  27.     ln:=ln+1;
  28.     set_foreground(lightblue);
  29.     swrite(#10+va(ln)+'> ');
  30.     set_foreground(white);
  31.    end;
  32.    s:=s+ch;
  33.   end;
  34.  until (ch=^N) or (length(s)=80);
  35.  set_foreground(default_fore);
  36.  if length(s)=80 then swriteln('Maximum length reached.');
  37. end;
  38.  
  39. procedure display_macro(s: string);
  40. var
  41.  ln: byte;
  42.  a: integer;
  43. begin;
  44.  ln:=1;
  45.  if s='' then swriteln('No macro recorded.') else begin;
  46.   set_Foreground(lightblue);
  47.   swrite(va(ln)+'> ');
  48.   set_foreground(white);
  49.   for a:=1 to length(s) do begin;
  50.    swrite(s[a]);
  51.    if s[a]=#13 then begin;
  52.     ln:=ln+1;
  53.     swrite(#10);
  54.     set_foreground(lightblue);
  55.     swrite(va(ln)+'> ');
  56.     set_foreground(white);
  57.    end;
  58.   end;
  59.  end;
  60.  swriteln('');
  61.  swriteln('');
  62. end;
  63.  
  64. End.